package com.dalei.vdsmanager.management.vds.action;

import java.util.List;

import com.dalei.vdsmanager.management.vds.dao.VDSDeviceInformation;
import com.dalei.vdsmanager.management.vds.service.VDSDeviceInformationService;
import com.opensymphony.xwork2.ActionSupport;

public class ListVDSDeviceInformationAction extends ActionSupport {

	/**
	 * 
	 */
	private static final long serialVersionUID = 3294073363393548781L;
	
	private VDSDeviceInformationService vdsDeviceInformationService;
	
	private List<VDSDeviceInformation> vdsDeviceInformations;

	public VDSDeviceInformationService getVdsDeviceInformationService() {
		return vdsDeviceInformationService;
	}

	public void setVdsDeviceInformationService(
			VDSDeviceInformationService vdsDeviceInformationService) {
		this.vdsDeviceInformationService = vdsDeviceInformationService;
	}

	public List<VDSDeviceInformation> getVdsDeviceInformations() {
		return vdsDeviceInformations;
	}

	public void setVdsDeviceInformations(
			List<VDSDeviceInformation> vdsDeviceInformations) {
		this.vdsDeviceInformations = vdsDeviceInformations;
	}

	@Override
	public String execute() throws Exception {
		// TODO Auto-generated method stub
		// return super.execute();
		vdsDeviceInformations = vdsDeviceInformationService.getVDSDeviceInformations();
		if (vdsDeviceInformations != null) {
			return SUCCESS;
		} else {
			return ERROR;
		}
		
	}
}
